package com.cy.mall.dao.mapper.dict;

import com.cy.mall.model.domain.dict.Dict;
import com.cy.mall.model.enums.DictType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

/**
 * @Description 数据字典 DictMapper
 * @Author tanyilin
 * @Date 2019/4/18 15:54
 */
@Mapper
public interface DictMapper extends BaseMapper<Dict> {

    /**
     * 根据 type 查询数据字典数组
     * @param type
     * @return java.util.List<com.cy.mall.model.domain.dict.Dict>
     */
    List<Dict> selectByType(@Param("type") DictType type);

    /**
     * 根据 type、key 查询唯一数据字典
     * @param type
     * @param key
     * @return com.cy.mall.model.domain.dict.Dict
     */
    Dict selectByTypeAndKey(@Param("type") DictType type, @Param("key") String key);

}
